IF OBJECT_ID ('dbo.VS_USER') IS NOT NULL
	DROP TABLE dbo.VS_USER
GO

CREATE TABLE dbo.VS_USER
	(
	id       INT IDENTITY NOT NULL,
	name     VARCHAR (20) NOT NULL,
	email    VARCHAR (30) NOT NULL,
	tel      VARCHAR (20) NULL,
	play     VARCHAR (50) NULL,
	account  MONEY NULL,
	password VARCHAR (20) NULL,
	adress   VARCHAR (400) NULL,
	area     VARCHAR (50) NULL,
	CONSTRAINT PK_VU_ID PRIMARY KEY (id),
	CONSTRAINT UQ_VU_EMAIL UNIQUE (email),
	CONSTRAINT UQ_VU_NAME UNIQUE (name)
	)
GO


IF OBJECT_ID ('dbo.VSPLAY') IS NOT NULL
	DROP TABLE dbo.VSPLAY
GO

CREATE TABLE dbo.VSPLAY
	(
	id               INT IDENTITY NOT NULL,
	challenger       VARCHAR (20) NULL,
	play             VARCHAR (50) NULL,
	area             VARCHAR (50) NULL,
	gamemoney        MONEY NULL,
	challengerid INT NULL,
	acceptid     INT NULL,
	challengerpalyid VARCHAR (50) NULL,
	acceptplayid     VARCHAR (50) NULL,
	accept           VARCHAR (20) NULL,
	chelltime        DATETIME NULL,
	acctime          DATETIME NULL,
	playtime         DATETIME NULL,
	playimage        VARCHAR (100) NULL,
	result           INT NULL DEFAULT 0,
	status           INT NULL DEFAULT 0,
	CONSTRAINT PK_VSPLAY PRIMARY KEY (id)
	)
GO

